﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using C1.Win.C1Input;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_KhachHangThanhToan : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("advKhachHang")]
        private ADVObjects _advKhachHang;
        [AccessedThroughProperty("AdvNganhang")]
        private ADVObjects _AdvNganhang;
        [AccessedThroughProperty("AdvNhanVien")]
        private ADVObjects _AdvNhanVien;
        [AccessedThroughProperty("AdvTaiKhoan")]
        private ADVAccount _AdvTaiKhoan;
        [AccessedThroughProperty("AdvTKCo")]
        private ADVAccount _AdvTKCo;
        [AccessedThroughProperty("CboHinhThuc")]
        private ComboBox _CboHinhThuc;
        [AccessedThroughProperty("CboLoaiTien")]
        private ComboBox _CboLoaiTien;
        [AccessedThroughProperty("CKCheckAll")]
        private CheckBox _CKCheckAll;
        [AccessedThroughProperty("CmdAdd")]
        private ToolStripButton _CmdAdd;
        [AccessedThroughProperty("CmdDel")]
        private ToolStripButton _CmdDel;
        [AccessedThroughProperty("CmdEdit")]
        private ToolStripButton _CmdEdit;
        [AccessedThroughProperty("CmdExit")]
        private ToolStripButton _CmdExit;
        [AccessedThroughProperty("CmdFind")]
        private ToolStripButton _CmdFind;
        [AccessedThroughProperty("CmdHelp")]
        private ToolStripButton _CmdHelp;
        [AccessedThroughProperty("CmdPrint")]
        private ToolStripButton _CmdPrint;
        [AccessedThroughProperty("CmdSave")]
        private ToolStripButton _CmdSave;
        [AccessedThroughProperty("CmdUnsave")]
        private ToolStripButton _CmdUnsave;
        [AccessedThroughProperty("CmdViewCongNo")]
        private Button _CmdViewCongNo;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label10")]
        private Label _Label10;
        [AccessedThroughProperty("Label11")]
        private Label _Label11;
        [AccessedThroughProperty("Label12")]
        private Label _Label12;
        [AccessedThroughProperty("Label13")]
        private Label _Label13;
        [AccessedThroughProperty("Label14")]
        private Label _Label14;
        [AccessedThroughProperty("Label15")]
        private Label _Label15;
        [AccessedThroughProperty("Label16")]
        private Label _Label16;
        [AccessedThroughProperty("Label17")]
        private Label _Label17;
        [AccessedThroughProperty("Label18")]
        private Label _Label18;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("Label4")]
        private Label _Label4;
        [AccessedThroughProperty("Label5")]
        private Label _Label5;
        [AccessedThroughProperty("Label6")]
        private Label _Label6;
        [AccessedThroughProperty("Label7")]
        private Label _Label7;
        [AccessedThroughProperty("Label8")]
        private Label _Label8;
        [AccessedThroughProperty("Label9")]
        private Label _Label9;
        [AccessedThroughProperty("Panel4")]
        private Panel _Panel4;
        [AccessedThroughProperty("Panel5")]
        private Panel _Panel5;
        [AccessedThroughProperty("TabControl1")]
        private TabControl _TabControl1;
        [AccessedThroughProperty("TabDetails")]
        private TabControl _TabDetails;
        [AccessedThroughProperty("TabPage1")]
        private TabPage _TabPage1;
        [AccessedThroughProperty("TabPage2")]
        private TabPage _TabPage2;
        [AccessedThroughProperty("ToolStrip1")]
        private ToolStrip _ToolStrip1;
        [AccessedThroughProperty("ToolStripButton1")]
        private ToolStripSeparator _ToolStripButton1;
        [AccessedThroughProperty("ToolStripSeparator1")]
        private ToolStripSeparator _ToolStripSeparator1;
        [AccessedThroughProperty("ToolStripSeparator2")]
        private ToolStripSeparator _ToolStripSeparator2;
        [AccessedThroughProperty("ToolStripSeparator3")]
        private ToolStripSeparator _ToolStripSeparator3;
        [AccessedThroughProperty("TxtChungTuDinhKem")]
        private TextBox _TxtChungTuDinhKem;
        [AccessedThroughProperty("TxtDienGiai")]
        private TextBox _TxtDienGiai;
        [AccessedThroughProperty("TxtNgayChungTu")]
        private DateTimePicker _TxtNgayChungTu;
        [AccessedThroughProperty("TxtSoChungTu")]
        private TextBox _TxtSoChungTu;
        [AccessedThroughProperty("TxtSoTien")]
        private C1NumericEdit _TxtSoTien;
        [AccessedThroughProperty("TxtSoTienKPB")]
        private C1NumericEdit _TxtSoTienKPB;
        [AccessedThroughProperty("TxtSoTienKPBNT")]
        private C1NumericEdit _TxtSoTienKPBNT;
        [AccessedThroughProperty("TxtSoTienNT")]
        private C1NumericEdit _TxtSoTienNT;
        [AccessedThroughProperty("TxtSoTienThanhToan")]
        private C1NumericEdit _TxtSoTienThanhToan;
        [AccessedThroughProperty("TxtSoTienThanhToanNT")]
        private C1NumericEdit _TxtSoTienThanhToanNT;
        [AccessedThroughProperty("TxtTongSoDuNo")]
        private C1NumericEdit _TxtTongSoDuNo;
        [AccessedThroughProperty("txtTyGia")]
        private C1NumericEdit _txtTyGia;
        [AccessedThroughProperty("VSlist")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSlist;
        private string cFrmFormat;
        public string cFrmKhoa;
        private string cFrmKhoaOld;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private bool mEnabledControl;
        private string mLoaiChungTu;
        private clsSoChungTu objSoCT;
        private clsThanhToan objTT;
        private clsThanhToanChiTiet objTTCT;

        public Frm_KhachHangThanhToan()
        {
            base.Load += new EventHandler(this.Frm_PhieuThu_Load);
            base.KeyDown += new KeyEventHandler(this.Frm_KhachHangThanhToan_KeyDown);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.mLoaiChungTu = "KHTT";
            this.cFrmKhoa = "";
            this.cFrmKhoaOld = "";
            this.objSoCT = new clsSoChungTu();
            this.objTT = new clsThanhToan();
            this.objTTCT = new clsThanhToanChiTiet();
            this.InitializeComponent();
        }

        private void advKhachHang_ValueChanged(object sender, EventArgs e)
        {
            this.LoadThanhToan();
            double num = new clsDMDoiTuong().GetSoDuCongNo(this.advKhachHang.Value, LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6), "NO", modGeneral.H_CLIENT, "131");
            this.TxtTongSoDuNo.Value = num;
        }

        private void AdvNhanVien_ValueChanged(object sender, EventArgs e)
        {
            this.LoadThanhToan();
        }

        private void AdvTaiKhoan_ValueChanged(object sender, EventArgs e)
        {
            clsDMTaiKhoan khoan = new clsDMTaiKhoan();
            if (khoan.Load(this.AdvTaiKhoan.Value))
            {
                this.CboLoaiTien.SelectedValue = khoan.LoaiTien;
                this.CboLoaiTien_SelectedIndexChanged(RuntimeHelpers.GetObjectValue(sender), e);
            }
        }

        private void CboHinhThuc_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboHinhThuc.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "CK")
            {
                this.AdvNganhang.ReadOnly = false;
                this.AdvTaiKhoan.KeyFilter = "112";
            }
            else
            {
                this.AdvNganhang.Value = "";
                this.AdvTaiKhoan.KeyFilter = "111";
                this.AdvNganhang.ReadOnly = true;
            }
        }

        private void CboLoaiTien_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                this.txtTyGia.Value = 0;
            }
            else
            {
                string strCode = this.CboLoaiTien.SelectedValue.ToString();
                if (strCode != "System.Data.DataRowView")
                {
                    clsDMLoaiTien tien = new clsDMLoaiTien();
                    tien.LoadByCode(strCode);
                    this.txtTyGia.Value = tien.TyGia;
                    if (tien.SoLe > 0)
                    {
                        this.cFrmFormat = modGeneral.H_FORMATNUMBER + "." + LVYModule.sRight("##########", tien.SoLe);
                    }
                    if (tien.TienViet == 1)
                    {
                        this.txtTyGia.Enabled = false;
                    }
                    this.FormatNumber();
                    if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() != "")
                    {
                        this.TxtSoTienThanhToanNT.ReadOnly = false;
                    }
                    else
                    {
                        this.TxtSoTienThanhToanNT.Value = 0;
                        this.TxtSoTienThanhToanNT_LostFocus(RuntimeHelpers.GetObjectValue(sender), e);
                        this.TxtSoTienThanhToanNT.ReadOnly = true;
                    }
                }
            }
        }

        public bool CheckIvalid()
        {
            if (this.TxtSoChungTu.Text.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập số chứng từ!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (!LVYModule.CheckDateLock(LVYModule.Date2Char(this.TxtNgayChungTu.Text)))
            {
                return false;
            }
            if (this.AdvTaiKhoan.Value.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập số t\x00e0i khoản!", ""));
                this.AdvTaiKhoan.Focus();
                return false;
            }
            if (this.TxtDienGiai.Text.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập diễn giải của chứng từ!", ""));
                this.TxtDienGiai.Focus();
                return false;
            }
            if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienThanhToanNT.Value), 0, modGeneral.TypeOfValue.Nothing)) == 0.0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập số tiền thanh to\x00e1n!", ""));
                return false;
            }
            if (this.objTT.TrungSoChungTu(this.TxtSoChungTu.Text.Trim(), this.cFrmKhoa))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Số chứng từ n\x00e0y đ\x00e3 tồn tại, bạn phải nhập số chứng từ kh\x00e1c!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if ((Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienKPBNT.Value), 0, modGeneral.TypeOfValue.Nothing)) != 0.0) && (this.AdvTKCo.Value.Trim() == ""))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập t\x00e0i khoản c\x00f3!", ""));
                this.AdvTKCo.Focus();
                return false;
            }
            return true;
        }

        public bool CheckIvalidGrid()
        {
            bool flag=false;
            return flag;
        }

        private void CmdAdd_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.Trim() != "")
            {
                this.cFrmKhoaOld = this.cFrmKhoa;
            }
            this.EmptyData();
            this.cFrmKhoa = modGeneral.CreatKey("BH_KhachHangThanhToan", 15, "RE");
            this.objSoCT.Load(this.mLoaiChungTu);
            this.TxtSoChungTu.Text = this.objSoCT.CreateVoucher(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6), 1);
            this.AdvTaiKhoan.Value = LVYModule.ReturnIfNull(modGeneral.H_ACCNORECEIPTNOTE, "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            this.EnabledControl = true;
            this.TxtSoChungTu.Focus();
            this.InitDefaultValue();
        }

        private void CmdDel_Click(object sender, EventArgs e)
        {
            if (((this.cFrmKhoa != "") && LVYModule.CheckDateLock(LVYModule.Date2Char(this.TxtNgayChungTu.Text))) && (LVYModule.ConfirmDelete("") && this.objTT.DeleteData(this.cFrmKhoa)))
            {
                this.EmptyData();
            }
        }

        private void CmdEdit_Click(object sender, EventArgs e)
        {
            this.cFrmKhoaOld = this.cFrmKhoa;
            this.LoadThanhToanEdit();
            this.EnabledControl = true;
        }

        private void CmdExit_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdFind_Click(object sender, EventArgs e)
        {
            try
            {
                MyProject.Forms.Frm_ThuTienBanHangList.Dispose();
                MyProject.Forms.Frm_ThuTienBanHangList.ShowDialog();
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                ProjectData.ClearProjectError();
            }
        }

        private void CmdPrint_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.ToString().Trim() != "")
            {
                ReportModule.PrintKHThanhToan(this.cFrmKhoa);
            }
        }

        private void CmdSave_Click(object sender, EventArgs e)
        {
            if (this.CheckIvalid())
            {
                if (!this.SaveDetailsTemp())
                {
                    this.objTT.ClearTemp(this.cFrmKhoa);
                }
                else if (!this.UpdateData())
                {
                    this.objTT.ClearTemp(this.cFrmKhoa);
                }
                else
                {
                    this.objTT.ClearTemp(this.cFrmKhoa);
                    this.EnabledControl = false;
                }
            }
        }

        private void CmdUnsave_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoaOld.Trim() != "")
            {
                this.cFrmKhoa = this.cFrmKhoaOld;
                this.ShowData(this.cFrmKhoa);
            }
            this.EnabledControl = false;
        }

        private void CmdViewCongNo_Click(object sender, EventArgs e)
        {
            if (this.advKhachHang.Value.Trim() != "")
            {
                MyProject.Forms.Frm_TruyVanCongNoPhaiThu.cFrmKhoaDoiTuong = this.advKhachHang.Value;
                MyProject.Forms.Frm_TruyVanCongNoPhaiThu.cFrmNamThang = LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6);
                MyProject.Forms.Frm_TruyVanCongNoPhaiThu.ShowDialog();
            }
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        public void EmptyData()
        {
            this.TxtSoChungTu.Text = "";
            this.TxtNgayChungTu.Text = Strings.Format(DateAndTime.Today, "dd/MM/yyyy");
            this.CboLoaiTien.SelectedValue = "";
            this.txtTyGia.Value = 0;
            this.TxtDienGiai.Text = "";
            this.TxtChungTuDinhKem.Text = "";
            this.AdvTaiKhoan.Value = "";
            this.VSlist.Rows.Count = 1;
            this.advKhachHang.Value = "";
            this.TxtSoTienThanhToanNT.Value = 0;
            this.TxtSoTienThanhToan.Value = 0;
            this.VSlist.Rows.Count = 1;
            this.TxtTongSoDuNo.Value = 0;
            this.TxtSoTienKPBNT.Value = 0;
            this.TxtSoTienKPB.Value = 0;
            this.AdvTKCo.Value = "";
            this.TxtSoTienNT.Value = 0;
            this.TxtSoTien.Value = 0;
        }

        public void FormatNumber()
        {
            this.txtTyGia.FormatType = FormatTypeEnum.CustomFormat;
            this.txtTyGia.CustomFormat = this.cFrmFormat;
            this.TxtSoTienNT.FormatType = FormatTypeEnum.CustomFormat;
            this.TxtSoTienNT.CustomFormat = this.cFrmFormat;
            this.TxtSoTien.FormatType = FormatTypeEnum.CustomFormat;
            this.TxtSoTien.CustomFormat = modGeneral.H_FORMATNUMBER;
            this.TxtSoTienThanhToanNT.FormatType = FormatTypeEnum.CustomFormat;
            this.TxtSoTienThanhToanNT.CustomFormat = this.cFrmFormat;
            this.TxtSoTienThanhToan.FormatType = FormatTypeEnum.CustomFormat;
            this.TxtSoTienThanhToan.CustomFormat = modGeneral.H_FORMATNUMBER;
            this.TxtSoTienKPBNT.FormatType = FormatTypeEnum.CustomFormat;
            this.TxtSoTienKPBNT.CustomFormat = this.cFrmFormat;
            this.TxtSoTienKPB.FormatType = FormatTypeEnum.CustomFormat;
            this.TxtSoTienKPB.CustomFormat = modGeneral.H_FORMATNUMBER;
            this.VSlist.Cols[10].DataType = System.Type.GetType("System.Decimal");
            this.VSlist.Cols[11].DataType = System.Type.GetType("System.Decimal");
            this.VSlist.Cols[12].DataType = System.Type.GetType("System.Decimal");
            this.VSlist.Cols[13].DataType = System.Type.GetType("System.Decimal");
            this.VSlist.Cols[14].DataType = System.Type.GetType("System.Decimal");
            this.VSlist.Cols[10].Format = this.cFrmFormat;
            this.VSlist.Cols[11].Format = this.cFrmFormat;
            this.VSlist.Cols[12].Format = this.cFrmFormat;
            this.VSlist.Cols[13].Format = this.cFrmFormat;
            this.VSlist.Cols[14].Format = this.cFrmFormat;
        }

        private void Frm_KhachHangThanhToan_KeyDown(object sender, KeyEventArgs e)
        {
            Keys keyCode = e.KeyCode;
            if (keyCode == Keys.Escape)
            {
                if (this.CmdExit.Enabled)
                {
                    this.CmdExit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F2)
            {
                if (this.CmdEdit.Enabled)
                {
                    this.CmdEdit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F3)
            {
                this.CmdFind_Click(RuntimeHelpers.GetObjectValue(sender), e);
            }
            else if (keyCode == Keys.F8)
            {
                if (this.CmdAdd.Enabled)
                {
                    this.CmdAdd_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F9)
            {
                if (this.CmdDel.Enabled)
                {
                    this.CmdDel_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F10)
            {
                if (this.CmdSave.Enabled)
                {
                    this.CmdSave_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F11)
            {
                if (this.CmdUnsave.Enabled)
                {
                    this.CmdUnsave_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if ((keyCode == Keys.F12) && this.CmdPrint.Enabled)
            {
                this.CmdPrint_Click(RuntimeHelpers.GetObjectValue(sender), e);
            }
        }

        private void Frm_PhieuThu_Load(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.EnabledControl = false;
                BuildComboModule.BuildCombo(this.CboLoaiTien, modGeneral.ListDanhMuc.LoaiTien, false, "", "");
                this.cFrmFormat = modGeneral.H_FORMATNUMBER;
                this.initComboHinhThuc();
                this.CboHinhThuc.SelectedValue = "TM";
                if (this.cFrmKhoa.Trim() != "")
                {
                    this.ShowData(this.cFrmKhoa);
                }
                this.Cursor = Cursors.Default;
            }
        }

        public void initComboHinhThuc()
        {
            object instance = new DataTable();
            NewLateBinding.LateCall(NewLateBinding.LateGet(instance, null, "Columns", new object[0], null, null, null), null, "Add", new object[] { "Ma", System.Type.GetType("System.String") }, null, null, null, true);
            NewLateBinding.LateCall(NewLateBinding.LateGet(instance, null, "Columns", new object[0], null, null, null), null, "Add", new object[] { "Ten", System.Type.GetType("System.String") }, null, null, null, true);
            DataRow row = (DataRow) NewLateBinding.LateGet(instance, null, "NewRow", new object[0], null, null, null);
            row[0] = "TM";
            row[1] = modGeneral.Tranlated("Tiền mặt", "");
            object[] arguments = new object[] { row };
            bool[] copyBack = new bool[] { true };
            NewLateBinding.LateCall(NewLateBinding.LateGet(instance, null, "Rows", new object[0], null, null, null), null, "Add", arguments, null, null, copyBack, true);
            if (copyBack[0])
            {
                row = (DataRow) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(arguments[0]), typeof(DataRow));
            }
            row = (DataRow) NewLateBinding.LateGet(instance, null, "NewRow", new object[0], null, null, null);
            row[0] = "CK";
            row[1] = modGeneral.Tranlated("Chuyển khoản", "");
            object[] objArray = new object[] { row };
            copyBack = new bool[] { true };
            NewLateBinding.LateCall(NewLateBinding.LateGet(instance, null, "Rows", new object[0], null, null, null), null, "Add", objArray, null, null, copyBack, true);
            if (copyBack[0])
            {
                row = (DataRow) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(objArray[0]), typeof(DataRow));
            }
            this.CboHinhThuc.DataSource = RuntimeHelpers.GetObjectValue(instance);
            this.CboHinhThuc.ValueMember = "Ma";
            this.CboHinhThuc.DisplayMember = "Ten";
        }

        public void InitDefaultValue()
        {
            this.AdvTaiKhoan.Value = modGeneral.H_DEFAULT.Item("H_TTK_TKCHU").GiaTri.ToString().Trim();
            EventArgs e = new EventArgs();
            this.AdvTaiKhoan_ValueChanged(this, e);
            this.AdvTKCo.Value = modGeneral.H_DEFAULT.Item("H_TTK_TKCO").GiaTri.ToString().Trim();
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_KhachHangThanhToan));
            this.Label4 = new Label();
            this.Panel5 = new Panel();
            this.TxtSoTien = new C1NumericEdit();
            this.TxtSoTienNT = new C1NumericEdit();
            this.Label5 = new Label();
            this.Panel4 = new Panel();
            this.Label18 = new Label();
            this.AdvTKCo = new ADVAccount();
            this.Label17 = new Label();
            this.Label16 = new Label();
            this.TxtSoTienKPB = new C1NumericEdit();
            this.TxtSoTienKPBNT = new C1NumericEdit();
            this.TabDetails = new TabControl();
            this.TabPage2 = new TabPage();
            this.CKCheckAll = new CheckBox();
            this.VSlist = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.TxtDienGiai = new TextBox();
            this.Label9 = new Label();
            this.TxtChungTuDinhKem = new TextBox();
            this.Label3 = new Label();
            this.TabPage1 = new TabPage();
            this.CmdViewCongNo = new Button();
            this.Label15 = new Label();
            this.TxtTongSoDuNo = new C1NumericEdit();
            this.AdvNhanVien = new ADVObjects();
            this.Label14 = new Label();
            this.Label12 = new Label();
            this.Label8 = new Label();
            this.TxtSoTienThanhToan = new C1NumericEdit();
            this.TxtSoTienThanhToanNT = new C1NumericEdit();
            this.advKhachHang = new ADVObjects();
            this.Label7 = new Label();
            this.CboHinhThuc = new ComboBox();
            this.Label6 = new Label();
            this.AdvNganhang = new ADVObjects();
            this.CboLoaiTien = new ComboBox();
            this.txtTyGia = new C1NumericEdit();
            this.Label11 = new Label();
            this.Label10 = new Label();
            this.Label2 = new Label();
            this.AdvTaiKhoan = new ADVAccount();
            this.Label13 = new Label();
            this.TxtNgayChungTu = new DateTimePicker();
            this.Label1 = new Label();
            this.TxtSoChungTu = new TextBox();
            this.TabControl1 = new TabControl();
            this.ToolStrip1 = new ToolStrip();
            this.CmdAdd = new ToolStripButton();
            this.CmdEdit = new ToolStripButton();
            this.ToolStripSeparator2 = new ToolStripSeparator();
            this.CmdSave = new ToolStripButton();
            this.CmdUnsave = new ToolStripButton();
            this.ToolStripSeparator1 = new ToolStripSeparator();
            this.CmdFind = new ToolStripButton();
            this.CmdPrint = new ToolStripButton();
            this.ToolStripButton1 = new ToolStripSeparator();
            this.CmdDel = new ToolStripButton();
            this.ToolStripSeparator3 = new ToolStripSeparator();
            this.CmdExit = new ToolStripButton();
            this.CmdHelp = new ToolStripButton();
            this.Panel5.SuspendLayout();
            ((ISupportInitialize) this.TxtSoTien).BeginInit();
            ((ISupportInitialize) this.TxtSoTienNT).BeginInit();
            this.Panel4.SuspendLayout();
            ((ISupportInitialize) this.TxtSoTienKPB).BeginInit();
            ((ISupportInitialize) this.TxtSoTienKPBNT).BeginInit();
            this.TabDetails.SuspendLayout();
            this.TabPage2.SuspendLayout();
            this.VSlist.BeginInit();
            this.TabPage1.SuspendLayout();
            ((ISupportInitialize) this.TxtTongSoDuNo).BeginInit();
            ((ISupportInitialize) this.TxtSoTienThanhToan).BeginInit();
            ((ISupportInitialize) this.TxtSoTienThanhToanNT).BeginInit();
            ((ISupportInitialize) this.txtTyGia).BeginInit();
            this.TabControl1.SuspendLayout();
            this.ToolStrip1.SuspendLayout();
            this.SuspendLayout();
            this.Label4.AutoSize = true;
            Point point = new Point(0x1ad, 0x21);
            this.Label4.Location = point;
            this.Label4.Name = "Label4";
            Size size = new Size(60, 13);
            this.Label4.Size = size;
            this.Label4.TabIndex = 0x63;
            this.Label4.Text = "Ng\x00e2n h\x00e0ng";
            this.Panel5.Controls.Add(this.TxtSoTien);
            this.Panel5.Controls.Add(this.TxtSoTienNT);
            this.Panel5.Controls.Add(this.Label5);
            this.Panel5.Dock = DockStyle.Right;
            point = new Point(0x263, 0);
            this.Panel5.Location = point;
            this.Panel5.Name = "Panel5";
            size = new Size(0x11b, 0x34);
            this.Panel5.Size = size;
            this.Panel5.TabIndex = 0;
            this.TxtSoTien.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoTien.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0xb6, 5);
            this.TxtSoTien.Location = point;
            this.TxtSoTien.Name = "TxtSoTien";
            Padding padding = new Padding(1);
            this.TxtSoTien.Padding = padding;
            this.TxtSoTien.ReadOnly = true;
            size = new Size(0x61, 20);
            this.TxtSoTien.Size = size;
            this.TxtSoTien.TabIndex = 2;
            this.TxtSoTien.Tag = null;
            this.TxtSoTien.TextAlign = HorizontalAlignment.Right;
            this.TxtSoTien.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtSoTien.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoTien.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoTienNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoTienNT.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0x54, 5);
            this.TxtSoTienNT.Location = point;
            this.TxtSoTienNT.Name = "TxtSoTienNT";
            padding = new Padding(1);
            this.TxtSoTienNT.Padding = padding;
            this.TxtSoTienNT.ReadOnly = true;
            size = new Size(0x61, 20);
            this.TxtSoTienNT.Size = size;
            this.TxtSoTienNT.TabIndex = 1;
            this.TxtSoTienNT.Tag = null;
            this.TxtSoTienNT.TextAlign = HorizontalAlignment.Right;
            this.TxtSoTienNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtSoTienNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoTienNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label5.AutoEllipsis = true;
            this.Label5.AutoSize = true;
            this.Label5.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0xa3);
            point = new Point(10, 8);
            this.Label5.Location = point;
            this.Label5.Name = "Label5";
            this.Label5.RightToLeft = RightToLeft.No;
            size = new Size(0x44, 13);
            this.Label5.Size = size;
            this.Label5.TabIndex = 0;
            this.Label5.Text = "Tổng cộng";
            this.Label5.TextAlign = ContentAlignment.TopRight;
            this.Panel4.Controls.Add(this.Label18);
            this.Panel4.Controls.Add(this.AdvTKCo);
            this.Panel4.Controls.Add(this.Label17);
            this.Panel4.Controls.Add(this.Label16);
            this.Panel4.Controls.Add(this.TxtSoTienKPB);
            this.Panel4.Controls.Add(this.TxtSoTienKPBNT);
            this.Panel4.Controls.Add(this.Panel5);
            this.Panel4.Dock = DockStyle.Bottom;
            point = new Point(0, 0x205);
            this.Panel4.Location = point;
            this.Panel4.Name = "Panel4";
            size = new Size(0x37e, 0x34);
            this.Panel4.Size = size;
            this.Panel4.TabIndex = 3;
            this.Label18.AutoSize = true;
            point = new Point(9, 0x1f);
            this.Label18.Location = point;
            this.Label18.Name = "Label18";
            size = new Size(70, 13);
            this.Label18.Size = size;
            this.Label18.TabIndex = 0;
            this.Label18.Text = "T\x00e0i khoản c\x00f3";
            this.AdvTKCo.Conditions = "";
            this.AdvTKCo.DefaultValue = "";
            this.AdvTKCo.FieldNameFilter = "Left(SoTaiKhoan,3)";
            this.AdvTKCo.KeyFilter = "111|112";
            point = new Point(0x6d, 0x1c);
            this.AdvTKCo.Location = point;
            padding = new Padding(0);
            this.AdvTKCo.Margin = padding;
            this.AdvTKCo.Name = "AdvTKCo";
            this.AdvTKCo.OnlyDigit = false;
            this.AdvTKCo.ReadOnly = false;
            size = new Size(0x110, 20);
            this.AdvTKCo.Size = size;
            this.AdvTKCo.TabIndex = 2;
            this.AdvTKCo.UpperText = true;
            this.AdvTKCo.Value = "";
            this.AdvTKCo.WithCode = 80;
            this.Label17.AutoSize = true;
            point = new Point(0xd4, 8);
            this.Label17.Location = point;
            this.Label17.Name = "Label17";
            size = new Size(0x2c, 13);
            this.Label17.Size = size;
            this.Label17.TabIndex = 5;
            this.Label17.Text = "Quy đổi";
            this.Label17.TextAlign = ContentAlignment.TopRight;
            this.Label16.AutoSize = true;
            point = new Point(8, 9);
            this.Label16.Location = point;
            this.Label16.Name = "Label16";
            size = new Size(0x5f, 13);
            this.Label16.Size = size;
            this.Label16.TabIndex = 3;
            this.Label16.Text = "Số kh\x00f4ng ph\x00e2n bổ";
            this.TxtSoTienKPB.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoTienKPB.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0x11c, 5);
            this.TxtSoTienKPB.Location = point;
            this.TxtSoTienKPB.Name = "TxtSoTienKPB";
            padding = new Padding(1);
            this.TxtSoTienKPB.Padding = padding;
            this.TxtSoTienKPB.ReadOnly = true;
            size = new Size(0x61, 20);
            this.TxtSoTienKPB.Size = size;
            this.TxtSoTienKPB.TabIndex = 1;
            this.TxtSoTienKPB.Tag = null;
            this.TxtSoTienKPB.TextAlign = HorizontalAlignment.Right;
            this.TxtSoTienKPB.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtSoTienKPB.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoTienKPB.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoTienKPBNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoTienKPBNT.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0x6d, 5);
            this.TxtSoTienKPBNT.Location = point;
            this.TxtSoTienKPBNT.Name = "TxtSoTienKPBNT";
            padding = new Padding(1);
            this.TxtSoTienKPBNT.Padding = padding;
            this.TxtSoTienKPBNT.ReadOnly = true;
            size = new Size(0x61, 20);
            this.TxtSoTienKPBNT.Size = size;
            this.TxtSoTienKPBNT.TabIndex = 0;
            this.TxtSoTienKPBNT.Tag = null;
            this.TxtSoTienKPBNT.TextAlign = HorizontalAlignment.Right;
            this.TxtSoTienKPBNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtSoTienKPBNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoTienKPBNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TabDetails.Controls.Add(this.TabPage2);
            this.TabDetails.Dock = DockStyle.Fill;
            point = new Point(0, 0xb0);
            this.TabDetails.Location = point;
            padding = new Padding(0);
            this.TabDetails.Margin = padding;
            this.TabDetails.Name = "TabDetails";
            this.TabDetails.SelectedIndex = 0;
            size = new Size(0x37e, 0x155);
            this.TabDetails.Size = size;
            this.TabDetails.TabIndex = 2;
            this.TabPage2.Controls.Add(this.CKCheckAll);
            this.TabPage2.Controls.Add(this.VSlist);
            point = new Point(4, 0x16);
            this.TabPage2.Location = point;
            this.TabPage2.Name = "TabPage2";
            padding = new Padding(3);
            this.TabPage2.Padding = padding;
            size = new Size(0x376, 0x13b);
            this.TabPage2.Size = size;
            this.TabPage2.TabIndex = 0;
            this.TabPage2.Text = "Th\x00f4ng tin chi ti\x00eát";
            this.TabPage2.UseVisualStyleBackColor = true;
            this.CKCheckAll.AutoSize = true;
            point = new Point(8, 6);
            this.CKCheckAll.Location = point;
            this.CKCheckAll.Name = "CKCheckAll";
            size = new Size(15, 14);
            this.CKCheckAll.Size = size;
            this.CKCheckAll.TabIndex = 0;
            this.CKCheckAll.UseVisualStyleBackColor = true;
            this.VSlist.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSlist.ColumnInfo = manager.GetString("VSlist.ColumnInfo");
            this.VSlist.Dock = DockStyle.Fill;
            this.VSlist.ExtendLastCol = true;
            this.VSlist.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new Point(3, 3);
            this.VSlist.Location = point;
            padding = new Padding(0);
            this.VSlist.Margin = padding;
            this.VSlist.Name = "VSlist";
            this.VSlist.Rows.Count = 1;
            this.VSlist.Rows.DefaultSize = 0x11;
            this.VSlist.Rows.MinSize = 20;
            size = new Size(880, 0x135);
            this.VSlist.Size = size;
            this.VSlist.StyleInfo = manager.GetString("VSlist.StyleInfo");
            this.VSlist.TabIndex = 0;
            this.VSlist.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;
            point = new Point(0x81, 0x63);
            this.TxtDienGiai.Location = point;
            this.TxtDienGiai.Name = "TxtDienGiai";
            size = new Size(0x126, 20);
            this.TxtDienGiai.Size = size;
            this.TxtDienGiai.TabIndex = 6;
            this.Label9.AutoEllipsis = true;
            this.Label9.AutoSize = true;
            point = new Point(0x33, 0x67);
            this.Label9.Location = point;
            this.Label9.Name = "Label9";
            this.Label9.RightToLeft = RightToLeft.No;
            size = new Size(0x30, 13);
            this.Label9.Size = size;
            this.Label9.TabIndex = 0x5f;
            this.Label9.Text = "Diễn giải";
            this.Label9.TextAlign = ContentAlignment.TopRight;
            point = new Point(0x81, 0x4c);
            this.TxtChungTuDinhKem.Location = point;
            this.TxtChungTuDinhKem.Name = "TxtChungTuDinhKem";
            size = new Size(0x126, 20);
            this.TxtChungTuDinhKem.Size = size;
            this.TxtChungTuDinhKem.TabIndex = 5;
            this.Label3.AutoEllipsis = true;
            this.Label3.AutoSize = true;
            point = new Point(0x33, 80);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            this.Label3.RightToLeft = RightToLeft.No;
            size = new Size(0x36, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 0x5d;
            this.Label3.Text = "Đ\x00ednh k\x00e8m";
            this.Label3.TextAlign = ContentAlignment.TopRight;
            this.TabPage1.Controls.Add(this.CmdViewCongNo);
            this.TabPage1.Controls.Add(this.Label15);
            this.TabPage1.Controls.Add(this.TxtTongSoDuNo);
            this.TabPage1.Controls.Add(this.AdvNhanVien);
            this.TabPage1.Controls.Add(this.Label14);
            this.TabPage1.Controls.Add(this.Label12);
            this.TabPage1.Controls.Add(this.Label8);
            this.TabPage1.Controls.Add(this.TxtSoTienThanhToan);
            this.TabPage1.Controls.Add(this.TxtSoTienThanhToanNT);
            this.TabPage1.Controls.Add(this.advKhachHang);
            this.TabPage1.Controls.Add(this.Label7);
            this.TabPage1.Controls.Add(this.CboHinhThuc);
            this.TabPage1.Controls.Add(this.Label6);
            this.TabPage1.Controls.Add(this.AdvNganhang);
            this.TabPage1.Controls.Add(this.Label4);
            this.TabPage1.Controls.Add(this.TxtDienGiai);
            this.TabPage1.Controls.Add(this.Label9);
            this.TabPage1.Controls.Add(this.TxtChungTuDinhKem);
            this.TabPage1.Controls.Add(this.Label3);
            this.TabPage1.Controls.Add(this.CboLoaiTien);
            this.TabPage1.Controls.Add(this.txtTyGia);
            this.TabPage1.Controls.Add(this.Label11);
            this.TabPage1.Controls.Add(this.Label10);
            this.TabPage1.Controls.Add(this.Label2);
            this.TabPage1.Controls.Add(this.AdvTaiKhoan);
            this.TabPage1.Controls.Add(this.Label13);
            this.TabPage1.Controls.Add(this.TxtNgayChungTu);
            this.TabPage1.Controls.Add(this.Label1);
            this.TabPage1.Controls.Add(this.TxtSoChungTu);
            point = new Point(4, 0x16);
            this.TabPage1.Location = point;
            this.TabPage1.Name = "TabPage1";
            padding = new Padding(3);
            this.TabPage1.Padding = padding;
            size = new Size(0x376, 0x7d);
            this.TabPage1.Size = size;
            this.TabPage1.TabIndex = 0;
            this.TabPage1.Text = "Th\x00f4ng tin phiếu thanh to\x00e1n";
            this.TabPage1.UseVisualStyleBackColor = true;
            this.CmdViewCongNo.BackgroundImage = ACCOUNTING.My.Resources.Resources.view;
            this.CmdViewCongNo.BackgroundImageLayout = ImageLayout.Center;
            point = new Point(0xea, 0x33);
            this.CmdViewCongNo.Location = point;
            this.CmdViewCongNo.Name = "CmdViewCongNo";
            size = new Size(0x18, 0x17);
            this.CmdViewCongNo.Size = size;
            this.CmdViewCongNo.TabIndex = 4;
            this.CmdViewCongNo.UseVisualStyleBackColor = true;
            this.Label15.AutoSize = true;
            point = new Point(0x33, 0x38);
            this.Label15.Location = point;
            this.Label15.Name = "Label15";
            size = new Size(0x4d, 13);
            this.Label15.Size = size;
            this.Label15.TabIndex = 0x73;
            this.Label15.Text = "Số dư c\x00f4ng nợ";
            this.TxtTongSoDuNo.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongSoDuNo.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0x81, 0x35);
            this.TxtTongSoDuNo.Location = point;
            this.TxtTongSoDuNo.Name = "TxtTongSoDuNo";
            padding = new Padding(1);
            this.TxtTongSoDuNo.Padding = padding;
            this.TxtTongSoDuNo.ReadOnly = true;
            size = new Size(0x68, 20);
            this.TxtTongSoDuNo.Size = size;
            this.TxtTongSoDuNo.TabIndex = 3;
            this.TxtTongSoDuNo.Tag = null;
            this.TxtTongSoDuNo.TextAlign = HorizontalAlignment.Right;
            this.TxtTongSoDuNo.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongSoDuNo.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongSoDuNo.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.AdvNhanVien.Conditions = "";
            this.AdvNhanVien.LoaiDoiTuong = modGeneral.TypeObjects.NhanVien;
            point = new Point(0x59, 0x83);
            this.AdvNhanVien.Location = point;
            this.AdvNhanVien.Name = "AdvNhanVien";
            this.AdvNhanVien.ReadOnly = true;
            size = new Size(0x126, 20);
            this.AdvNhanVien.Size = size;
            this.AdvNhanVien.TabIndex = 15;
            this.AdvNhanVien.UpperText = true;
            this.AdvNhanVien.Value = "";
            this.AdvNhanVien.WidthCode = 80;
            this.Label14.AutoSize = true;
            point = new Point(11, 0x87);
            this.Label14.Location = point;
            this.Label14.Name = "Label14";
            size = new Size(0x38, 13);
            this.Label14.Size = size;
            this.Label14.TabIndex = 14;
            this.Label14.Text = "Nh\x00e2n vi\x00ean";
            this.Label12.AutoSize = true;
            point = new Point(0x27d, 0x66);
            this.Label12.Location = point;
            this.Label12.Name = "Label12";
            size = new Size(0x2c, 13);
            this.Label12.Size = size;
            this.Label12.TabIndex = 0x6d;
            this.Label12.Text = "Quy đổi";
            this.Label12.TextAlign = ContentAlignment.TopRight;
            this.Label8.AutoSize = true;
            point = new Point(0x1ad, 0x66);
            this.Label8.Location = point;
            this.Label8.Name = "Label8";
            size = new Size(0x5e, 13);
            this.Label8.Size = size;
            this.Label8.TabIndex = 0x6c;
            this.Label8.Text = "Số tiền thanh to\x00e1n";
            this.Label8.TextAlign = ContentAlignment.TopRight;
            this.TxtSoTienThanhToan.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoTienThanhToan.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0x2bd, 0x63);
            this.TxtSoTienThanhToan.Location = point;
            this.TxtSoTienThanhToan.Name = "TxtSoTienThanhToan";
            padding = new Padding(1);
            this.TxtSoTienThanhToan.Padding = padding;
            this.TxtSoTienThanhToan.ReadOnly = true;
            size = new Size(0x65, 20);
            this.TxtSoTienThanhToan.Size = size;
            this.TxtSoTienThanhToan.TabIndex = 13;
            this.TxtSoTienThanhToan.Tag = null;
            this.TxtSoTienThanhToan.TextAlign = HorizontalAlignment.Right;
            this.TxtSoTienThanhToan.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtSoTienThanhToan.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoTienThanhToan.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoTienThanhToanNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoTienThanhToanNT.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0x20f, 0x63);
            this.TxtSoTienThanhToanNT.Location = point;
            this.TxtSoTienThanhToanNT.Name = "TxtSoTienThanhToanNT";
            padding = new Padding(1);
            this.TxtSoTienThanhToanNT.Padding = padding;
            size = new Size(0x69, 20);
            this.TxtSoTienThanhToanNT.Size = size;
            this.TxtSoTienThanhToanNT.TabIndex = 12;
            this.TxtSoTienThanhToanNT.Tag = null;
            this.TxtSoTienThanhToanNT.TextAlign = HorizontalAlignment.Right;
            this.TxtSoTienThanhToanNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtSoTienThanhToanNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoTienThanhToanNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.advKhachHang.Conditions = "";
            this.advKhachHang.LoaiDoiTuong = modGeneral.TypeObjects.KhachHang;
            point = new Point(0x81, 30);
            this.advKhachHang.Location = point;
            this.advKhachHang.Name = "advKhachHang";
            this.advKhachHang.ReadOnly = false;
            size = new Size(0x126, 20);
            this.advKhachHang.Size = size;
            this.advKhachHang.TabIndex = 2;
            this.advKhachHang.UpperText = true;
            this.advKhachHang.Value = "";
            this.advKhachHang.WidthCode = 80;
            this.Label7.AutoSize = true;
            point = new Point(0x33, 0x21);
            this.Label7.Location = point;
            this.Label7.Name = "Label7";
            size = new Size(0x41, 13);
            this.Label7.Size = size;
            this.Label7.TabIndex = 0x67;
            this.Label7.Text = "Kh\x00e1ch h\x00e0ng";
            this.CboHinhThuc.FormattingEnabled = true;
            point = new Point(0x20f, 6);
            this.CboHinhThuc.Location = point;
            this.CboHinhThuc.Name = "CboHinhThuc";
            size = new Size(0x113, 0x15);
            this.CboHinhThuc.Size = size;
            this.CboHinhThuc.TabIndex = 7;
            this.Label6.AutoSize = true;
            point = new Point(0x1ad, 9);
            this.Label6.Location = point;
            this.Label6.Name = "Label6";
            size = new Size(0x35, 13);
            this.Label6.Size = size;
            this.Label6.TabIndex = 0x65;
            this.Label6.Text = "H\x00ecnh thức";
            this.Label6.TextAlign = ContentAlignment.TopRight;
            this.AdvNganhang.Conditions = "";
            this.AdvNganhang.LoaiDoiTuong = modGeneral.TypeObjects.NganHang;
            point = new Point(0x20f, 30);
            this.AdvNganhang.Location = point;
            this.AdvNganhang.Name = "AdvNganhang";
            this.AdvNganhang.ReadOnly = false;
            size = new Size(0x113, 20);
            this.AdvNganhang.Size = size;
            this.AdvNganhang.TabIndex = 8;
            this.AdvNganhang.UpperText = true;
            this.AdvNganhang.Value = "";
            this.AdvNganhang.WidthCode = 80;
            this.CboLoaiTien.FormattingEnabled = true;
            point = new Point(0x20f, 0x4c);
            this.CboLoaiTien.Location = point;
            this.CboLoaiTien.Name = "CboLoaiTien";
            size = new Size(0x69, 0x15);
            this.CboLoaiTien.Size = size;
            this.CboLoaiTien.TabIndex = 10;
            this.txtTyGia.BorderStyle = BorderStyle.FixedSingle;
            this.txtTyGia.DataType = typeof(double);
            this.txtTyGia.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x2bd, 0x4c);
            this.txtTyGia.Location = point;
            this.txtTyGia.Name = "txtTyGia";
            padding = new Padding(1);
            this.txtTyGia.Padding = padding;
            size = new Size(0x65, 20);
            this.txtTyGia.Size = size;
            this.txtTyGia.TabIndex = 11;
            this.txtTyGia.Tag = null;
            this.txtTyGia.VisibleButtons = DropDownControlButtonFlags.DropDown;
            this.txtTyGia.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.txtTyGia.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label11.AutoSize = true;
            point = new Point(0x1ad, 80);
            this.Label11.Location = point;
            this.Label11.Name = "Label11";
            size = new Size(0x2f, 13);
            this.Label11.Size = size;
            this.Label11.TabIndex = 0x39;
            this.Label11.Text = "Loại tiền";
            this.Label11.TextAlign = ContentAlignment.TopRight;
            this.Label10.AutoSize = true;
            point = new Point(0x27d, 80);
            this.Label10.Location = point;
            this.Label10.Name = "Label10";
            size = new Size(0x24, 13);
            this.Label10.Size = size;
            this.Label10.TabIndex = 0x38;
            this.Label10.Text = "Tỷ gi\x00e1";
            this.Label10.TextAlign = ContentAlignment.TopRight;
            this.Label2.AutoSize = true;
            point = new Point(0x1ad, 0x38);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(70, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x25;
            this.Label2.Text = "T\x00e0i khoản nợ";
            this.AdvTaiKhoan.Conditions = "";
            this.AdvTaiKhoan.DefaultValue = "";
            this.AdvTaiKhoan.FieldNameFilter = "Left(SoTaiKhoan,3)";
            this.AdvTaiKhoan.KeyFilter = "111|112";
            point = new Point(0x20f, 0x35);
            this.AdvTaiKhoan.Location = point;
            padding = new Padding(0);
            this.AdvTaiKhoan.Margin = padding;
            this.AdvTaiKhoan.Name = "AdvTaiKhoan";
            this.AdvTaiKhoan.OnlyDigit = false;
            this.AdvTaiKhoan.ReadOnly = false;
            size = new Size(0x113, 20);
            this.AdvTaiKhoan.Size = size;
            this.AdvTaiKhoan.TabIndex = 9;
            this.AdvTaiKhoan.UpperText = true;
            this.AdvTaiKhoan.Value = "";
            this.AdvTaiKhoan.WithCode = 80;
            this.Label13.AutoSize = true;
            point = new Point(0x113, 10);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x20, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 0x23;
            this.Label13.Text = "Ng\x00e0y";
            this.TxtNgayChungTu.Format = DateTimePickerFormat.Short;
            point = new Point(0x14e, 7);
            this.TxtNgayChungTu.Location = point;
            this.TxtNgayChungTu.Name = "TxtNgayChungTu";
            size = new Size(0x59, 20);
            this.TxtNgayChungTu.Size = size;
            this.TxtNgayChungTu.TabIndex = 1;
            this.Label1.AutoSize = true;
            point = new Point(0x33, 10);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x41, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0x21;
            this.Label1.Text = "Số chứng từ";
            point = new Point(0x81, 7);
            this.TxtSoChungTu.Location = point;
            this.TxtSoChungTu.Name = "TxtSoChungTu";
            size = new Size(0x68, 20);
            this.TxtSoChungTu.Size = size;
            this.TxtSoChungTu.TabIndex = 0;
            this.TabControl1.Controls.Add(this.TabPage1);
            this.TabControl1.Dock = DockStyle.Top;
            point = new Point(0, 0x19);
            this.TabControl1.Location = point;
            this.TabControl1.Name = "TabControl1";
            this.TabControl1.SelectedIndex = 0;
            size = new Size(0x37e, 0x97);
            this.TabControl1.Size = size;
            this.TabControl1.TabIndex = 2;
            this.ToolStrip1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgbluenoborder;
            this.ToolStrip1.Items.AddRange(new ToolStripItem[] { this.CmdAdd, this.CmdEdit, this.ToolStripSeparator2, this.CmdSave, this.CmdUnsave, this.ToolStripSeparator1, this.CmdFind, this.CmdPrint, this.ToolStripButton1, this.CmdDel, this.ToolStripSeparator3, this.CmdExit, this.CmdHelp });
            point = new Point(0, 0);
            this.ToolStrip1.Location = point;
            this.ToolStrip1.Name = "ToolStrip1";
            size = new Size(0x37e, 0x19);
            this.ToolStrip1.Size = size;
            this.ToolStrip1.TabIndex = 0;
            this.ToolStrip1.Text = "ToolStrip1";
            this.CmdAdd.Image = (Image) manager.GetObject("CmdAdd.Image");
            this.CmdAdd.ImageTransparentColor = Color.White;
            this.CmdAdd.Name = "CmdAdd";
            size = new Size(0x52, 0x16);
            this.CmdAdd.Size = size;
            this.CmdAdd.Text = "&Th\x00eam mới";
            this.CmdEdit.Image = (Image) manager.GetObject("CmdEdit.Image");
            this.CmdEdit.ImageTransparentColor = Color.White;
            this.CmdEdit.Name = "CmdEdit";
            size = new Size(0x2e, 0x16);
            this.CmdEdit.Size = size;
            this.CmdEdit.Text = "&Sửa";
            this.ToolStripSeparator2.Name = "ToolStripSeparator2";
            size = new Size(6, 0x19);
            this.ToolStripSeparator2.Size = size;
            this.CmdSave.Image = (Image) manager.GetObject("CmdSave.Image");
            this.CmdSave.ImageTransparentColor = Color.WhiteSmoke;
            this.CmdSave.Name = "CmdSave";
            size = new Size(0x2f, 0x16);
            this.CmdSave.Size = size;
            this.CmdSave.Text = "&Lưu";
            this.CmdUnsave.Image = (Image) manager.GetObject("CmdUnsave.Image");
            this.CmdUnsave.ImageTransparentColor = Color.White;
            this.CmdUnsave.Name = "CmdUnsave";
            size = new Size(0x39, 0x16);
            this.CmdUnsave.Size = size;
            this.CmdUnsave.Text = "&K.Lưu";
            this.ToolStripSeparator1.Name = "ToolStripSeparator1";
            size = new Size(6, 0x19);
            this.ToolStripSeparator1.Size = size;
            this.CmdFind.Image = (Image) manager.GetObject("CmdFind.Image");
            this.CmdFind.ImageTransparentColor = Color.White;
            this.CmdFind.Name = "CmdFind";
            size = new Size(0x4d, 0x16);
            this.CmdFind.Size = size;
            this.CmdFind.Text = "T\x00ecm kiếm";
            this.CmdPrint.Image = (Image) manager.GetObject("CmdPrint.Image");
            this.CmdPrint.ImageTransparentColor = Color.White;
            this.CmdPrint.Name = "CmdPrint";
            size = new Size(0x25, 0x16);
            this.CmdPrint.Size = size;
            this.CmdPrint.Text = "&In";
            this.ToolStripButton1.Name = "ToolStripButton1";
            size = new Size(6, 0x19);
            this.ToolStripButton1.Size = size;
            this.CmdDel.Image = (Image) manager.GetObject("CmdDel.Image");
            this.CmdDel.ImageTransparentColor = Color.White;
            this.CmdDel.Name = "CmdDel";
            size = new Size(0x2f, 0x16);
            this.CmdDel.Size = size;
            this.CmdDel.Text = "&X\x00f3a";
            this.ToolStripSeparator3.Name = "ToolStripSeparator3";
            size = new Size(6, 0x19);
            this.ToolStripSeparator3.Size = size;
            this.CmdExit.Alignment = ToolStripItemAlignment.Right;
            this.CmdExit.Image = (Image) manager.GetObject("CmdExit.Image");
            this.CmdExit.ImageTransparentColor = Color.White;
            this.CmdExit.Name = "CmdExit";
            size = new Size(0x3a, 0x16);
            this.CmdExit.Size = size;
            this.CmdExit.Text = "Th&o\x00e1t";
            this.CmdHelp.Alignment = ToolStripItemAlignment.Right;
            this.CmdHelp.Image = (Image) manager.GetObject("CmdHelp.Image");
            this.CmdHelp.ImageTransparentColor = Color.Magenta;
            this.CmdHelp.Name = "CmdHelp";
            size = new Size(0x34, 0x16);
            this.CmdHelp.Size = size;
            this.CmdHelp.Text = "&Help";
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x37e, 0x239);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.TabDetails);
            this.Controls.Add(this.Panel4);
            this.Controls.Add(this.TabControl1);
            this.Controls.Add(this.ToolStrip1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.KeyPreview = true;
            this.Name = "Frm_KhachHangThanhToan";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "BH-0006             ";
            this.Text = "THU TIEN BAN HANG";
            this.Panel5.ResumeLayout(false);
            this.Panel5.PerformLayout();
            ((ISupportInitialize) this.TxtSoTien).EndInit();
            ((ISupportInitialize) this.TxtSoTienNT).EndInit();
            this.Panel4.ResumeLayout(false);
            this.Panel4.PerformLayout();
            ((ISupportInitialize) this.TxtSoTienKPB).EndInit();
            ((ISupportInitialize) this.TxtSoTienKPBNT).EndInit();
            this.TabDetails.ResumeLayout(false);
            this.TabPage2.ResumeLayout(false);
            this.TabPage2.PerformLayout();
            this.VSlist.EndInit();
            this.TabPage1.ResumeLayout(false);
            this.TabPage1.PerformLayout();
            ((ISupportInitialize) this.TxtTongSoDuNo).EndInit();
            ((ISupportInitialize) this.TxtSoTienThanhToan).EndInit();
            ((ISupportInitialize) this.TxtSoTienThanhToanNT).EndInit();
            ((ISupportInitialize) this.txtTyGia).EndInit();
            this.TabControl1.ResumeLayout(false);
            this.ToolStrip1.ResumeLayout(false);
            this.ToolStrip1.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();
        }

        public void LoadDetails(string strKhoa)
        {
            DataTable listDetails = this.objTT.GetListDetails(strKhoa);
            this.VSlist.Rows.Count = 1;
            if (listDetails != null)
            {
                C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                int num2 = listDetails.Rows.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    vSlist.AddItem("");
                    vSlist[vSlist.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["Khoa"]);
                    vSlist[vSlist.Rows.Count - 1, 1] = 1;
                    vSlist[vSlist.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaTaiKhoan"]);
                    vSlist[vSlist.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["SoTaiKhoan"]);
                    vSlist[vSlist.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["VE"]);
                    vSlist[vSlist.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaDoiTuong"]);
                    vSlist[vSlist.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TenDoiTuong"]);
                    vSlist[vSlist.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaChungTu"]);
                    vSlist[vSlist.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["SoChungTu"]);
                    vSlist[vSlist.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["NgayChungTu"]);
                    vSlist[vSlist.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TienHang"]);
                    vSlist[vSlist.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TienChietKhau"]);
                    vSlist[vSlist.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TienThue"]);
                    vSlist[vSlist.Rows.Count - 1, 13] = (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TienHang"]), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TienChietKhau"]), 0, modGeneral.TypeOfValue.Nothing))) + Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TienThue"]), 0, modGeneral.TypeOfValue.Nothing));
                    vSlist[vSlist.Rows.Count - 1, 14] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["DaThanhToan"]);
                    vSlist[vSlist.Rows.Count - 1, 15] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["ThanhToan"]);
                }
                vSlist = null;
                this.TotalOfVoucher();
            }
        }

        public void LoadThanhToan()
        {
            try
            {
                DataTable table = this.objTT.GetBanHangThanhToan(LVYModule.Date2Char(this.TxtNgayChungTu.Text), modGeneral.H_CLIENT, this.cFrmKhoa, LVYModule.ReturnIfNull(this.AdvNhanVien.Value, "", modGeneral.TypeOfValue.Nothing).ToString(), LVYModule.ReturnIfNull(this.advKhachHang.Value, "", modGeneral.TypeOfValue.Nothing).ToString());
                this.VSlist.Rows.Count = 1;
                if (table != null)
                {
                    int num2 = table.Rows.Count - 1;
                    for (int i = 0; i <= num2; i++)
                    {
                        C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                        vSlist.AddItem("");
                        vSlist[vSlist.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(table.Rows[i]["KhoaTKThanhToan"]);
                        vSlist[vSlist.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(table.Rows[i]["SoTaiKhoan"]);
                        vSlist[vSlist.Rows.Count - 1, 4] = "CO";
                        vSlist[vSlist.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(table.Rows[i]["KhoaDoiTuong"]);
                        vSlist[vSlist.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(table.Rows[i]["TenDoiTuong"]);
                        vSlist[vSlist.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(table.Rows[i]["Khoa"]);
                        vSlist[vSlist.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(table.Rows[i]["SoChungTu"]);
                        vSlist[vSlist.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(table.Rows[i]["NgayChungTu"]);
                        vSlist[vSlist.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(table.Rows[i]["TienHang"]);
                        vSlist[vSlist.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(table.Rows[i]["TienChietKhau"]);
                        vSlist[vSlist.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(table.Rows[i]["TienThueVAT"]);
                        vSlist[vSlist.Rows.Count - 1, 13] = (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(table.Rows[i]["TienHang"]), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(table.Rows[i]["TienChietKhau"]), 0, modGeneral.TypeOfValue.Nothing))) + Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(table.Rows[i]["TienThueVAT"]), 0, modGeneral.TypeOfValue.Nothing));
                        vSlist[vSlist.Rows.Count - 1, 14] = RuntimeHelpers.GetObjectValue(table.Rows[i]["DaThanhToan"]);
                        vSlist[vSlist.Rows.Count - 1, 15] = 0;
                        vSlist = null;
                    }
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                ProjectData.ClearProjectError();
            }
        }

        public void LoadThanhToanEdit()
        {
            DataTable table = this.objTT.GetBanHangThanhToan(LVYModule.Date2Char(this.TxtNgayChungTu.Text), this.cFrmKhoa, LVYModule.ReturnIfNull(this.AdvNhanVien.Value, "", modGeneral.TypeOfValue.Nothing).ToString(), LVYModule.ReturnIfNull(this.advKhachHang.Value, "", modGeneral.TypeOfValue.Nothing).ToString(), "");
            if (table != null)
            {
                int num2 = table.Rows.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                    vSlist.AddItem("");
                    vSlist[vSlist.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(table.Rows[i]["KhoaTKThanhToan"]);
                    vSlist[vSlist.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(table.Rows[i]["SoTaiKhoan"]);
                    vSlist[vSlist.Rows.Count - 1, 4] = "CO";
                    vSlist[vSlist.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(table.Rows[i]["KhoaDoiTuong"]);
                    vSlist[vSlist.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(table.Rows[i]["TenDoiTuong"]);
                    vSlist[vSlist.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(table.Rows[i]["Khoa"]);
                    vSlist[vSlist.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(table.Rows[i]["SoChungTu"]);
                    vSlist[vSlist.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(table.Rows[i]["NgayChungTu"]);
                    vSlist[vSlist.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(table.Rows[i]["TienHang"]);
                    vSlist[vSlist.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(table.Rows[i]["TienChietKhau"]);
                    vSlist[vSlist.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(table.Rows[i]["TienThueVAT"]);
                    vSlist[vSlist.Rows.Count - 1, 13] = (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(table.Rows[i]["TienHang"]), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(table.Rows[i]["TienChietKhau"]), 0, modGeneral.TypeOfValue.Nothing))) + Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(table.Rows[i]["TienThueVAT"]), 0, modGeneral.TypeOfValue.Nothing));
                    vSlist[vSlist.Rows.Count - 1, 14] = RuntimeHelpers.GetObjectValue(table.Rows[i]["DaThanhToan"]);
                    vSlist[vSlist.Rows.Count - 1, 15] = 0;
                    vSlist = null;
                }
            }
        }

        public void PhanBoSoTien()
        {
            double num2 = 0.0;
            double num3 = 0.0;
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienThanhToan.Value), 0, modGeneral.TypeOfValue.Nothing));
            int num4 = this.VSlist.Rows.Count - 1;
            for (int i = 1; i <= num4; i++)
            {
                num3 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 13]), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 14]), 0, modGeneral.TypeOfValue.Nothing));
                if (num2 > 0.0)
                {
                    if (num2 >= num3)
                    {
                        this.VSlist[i, 15] = num3;
                        num2 -= num3;
                    }
                    else
                    {
                        this.VSlist[i, 15] = num2;
                        num2 = 0.0;
                    }
                    this.VSlist[i, 1] = 1;
                }
            }
        }

        public bool SaveDetailsTemp()
        {
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            int num2 = this.VSlist.Rows.Count - 1;
            for (int i = 1; i <= num2; i++)
            {
                if (Conversion.Val(RuntimeHelpers.GetObjectValue(vSlist[i, 1])) != 0.0)
                {
                    if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                    {
                        vSlist[i, 0] = modGeneral.CreatKey("BH_ThanhToanChiTiet", 15, "RE");
                    }
                    this.objTTCT.Khoa = Conversions.ToString(vSlist[i, 0]);
                    this.objTTCT.KhoaTaiKhoan = Conversions.ToString(vSlist[i, 2]);
                    this.objTTCT.Ve = Conversions.ToString(vSlist[i, 4]);
                    this.objTTCT.KhoaThanhToan = this.cFrmKhoa;
                    this.objTTCT.KhoaDoiTuong = Conversions.ToString(vSlist[i, 5]);
                    this.objTTCT.KhoaChungTu = Conversions.ToString(vSlist[i, 7]);
                    this.objTTCT.SoChungTu = Conversions.ToString(vSlist[i, 8]);
                    this.objTTCT.NgayChungTu = LVYModule.Date2Char(Conversions.ToString(vSlist[i, 2]));
                    this.objTTCT.LoaiTien = Conversions.ToString(this.CboLoaiTien.SelectedValue);
                    this.objTTCT.TyGia = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
                    if (this.objTTCT.TyGia == 0.0)
                    {
                        this.objTTCT.TyGia = 1.0;
                    }
                    this.objTTCT.TienHang = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 10]), 0, modGeneral.TypeOfValue.Nothing));
                    this.objTTCT.TienHangNT = Math.Round((double) (this.objTTCT.TienHang / this.objTTCT.TyGia), 2);
                    this.objTTCT.TienChietKhau = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 11]), 0, modGeneral.TypeOfValue.Nothing));
                    this.objTTCT.TienChietKhauNT = Math.Round((double) (this.objTTCT.TienChietKhau / this.objTTCT.TyGia), 2);
                    this.objTTCT.TienThue = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 12]), 0, modGeneral.TypeOfValue.Nothing));
                    this.objTTCT.TienThueNT = Math.Round((double) (this.objTTCT.TienThue / this.objTTCT.TyGia), 2);
                    this.objTTCT.ThanhToan = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 15]), 0, modGeneral.TypeOfValue.Nothing));
                    this.objTTCT.ThanhToanNT = Math.Round((double) (this.objTTCT.ThanhToan / this.objTTCT.TyGia), 2);
                    if (!this.objTTCT.Save())
                    {
                        return false;
                    }
                }
            }
            vSlist = null;
            return true;
        }

        public void ShowData(string strKhoa)
        {
            this.objTT.Load(strKhoa);
            clsThanhToan objTT = this.objTT;
            this.cFrmKhoa = strKhoa;
            this.TxtSoChungTu.Text = objTT.SoChungTu;
            this.TxtNgayChungTu.Text = LVYModule.Char2Date(objTT.NgayChungTu);
            this.advKhachHang.Value = objTT.KhoaDoiTuong;
            this.TxtChungTuDinhKem.Text = objTT.ChungTuDinhKem;
            this.TxtDienGiai.Text = objTT.DienGiai;
            this.CboHinhThuc.SelectedValue = objTT.HinhThucThanhToan;
            this.AdvTaiKhoan.Value = objTT.KhoaTaiKhoanChu;
            this.AdvNganhang.Value = objTT.KhoaNganHang;
            this.CboLoaiTien.SelectedValue = objTT.LoaiTien;
            this.txtTyGia.Value = objTT.TyGia;
            this.TxtSoTienThanhToanNT.Value = objTT.SoTienNT;
            this.TxtSoTienThanhToan.Value = objTT.SoTien;
            this.AdvTKCo.Value = objTT.KhoaTaiKhoanDoi;
            this.TxtSoTienKPBNT.Value = objTT.SoTienKhongPhanBoNT;
            this.TxtSoTienKPB.Value = objTT.SoTienKhongPhanBo;
            this.LoadDetails(strKhoa);
            objTT = null;
        }

        public double SumColOfGrid()
        {
            double num2 = 0.0;
            int num4 = this.VSlist.Rows.Count - 1;
            for (int i = 0; i <= num4; i++)
            {
                if (Conversion.Val(RuntimeHelpers.GetObjectValue(this.VSlist[i, 1])) != 0.0)
                {
                    num2 += Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 15]), 0, modGeneral.TypeOfValue.Nothing));
                }
            }
            return num2;
        }

        public void TotalOfVoucher()
        {
            double num = this.SumColOfGrid();
            this.TxtSoTien.Value = num;
            this.TxtSoTienNT.Value = LVYModule.SumColGrid(this.VSlist, 14);
            if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing)) != 0.0)
            {
                this.TxtSoTienNT.Value = Math.Round((double) (num / Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing))), 2);
            }
            if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienThanhToanNT.Value), 0, modGeneral.TypeOfValue.Nothing)) > Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienNT.Value), 0, modGeneral.TypeOfValue.Nothing)))
            {
                this.TxtSoTienKPBNT.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienThanhToanNT.Value), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienNT.Value), 0, modGeneral.TypeOfValue.Nothing));
                this.TxtSoTienKPB.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienThanhToan.Value), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTien.Value), 0, modGeneral.TypeOfValue.Nothing));
            }
        }

        private void TxtSoTienThanhToanNT_LostFocus(object sender, EventArgs e)
        {
            double num = 0.0;
            double num2 = 0.0;
            this.TxtSoTienThanhToan.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienThanhToanNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienThanhToan.Value), 0, modGeneral.TypeOfValue.Nothing));
            num2 = this.SumColOfGrid();
            if (((LVYModule.ReturnIfNull(this.advKhachHang.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "") && ((num > num2) & (this.VSlist.Rows.Count > 1))) && LVYModule.ConfirmDelete(modGeneral.Tranlated("Bạn c\x00f3 muốn tự động ph\x00e2n bổ số tiền kh\x00f4ng?", "")))
            {
                this.PhanBoSoTien();
            }
            this.TotalOfVoucher();
            if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienThanhToanNT.Value), 0, modGeneral.TypeOfValue.Nothing)) > Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienNT.Value), 0, modGeneral.TypeOfValue.Nothing)))
            {
                this.TxtSoTienKPBNT.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienThanhToanNT.Value), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienNT.Value), 0, modGeneral.TypeOfValue.Nothing));
                this.TxtSoTienKPB.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienThanhToan.Value), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTien.Value), 0, modGeneral.TypeOfValue.Nothing));
            }
            else
            {
                this.TxtSoTienKPBNT.Value = 0;
                this.TxtSoTienKPB.Value = 0;
            }
        }

        public bool UpdateData()
        {
            bool flag=false;
            clsThanhToan objTT = this.objTT;
            objTT.Khoa = this.cFrmKhoa;
            objTT.SoChungTu = this.TxtSoChungTu.Text;
            objTT.NgayChungTu = LVYModule.Date2Char(this.TxtNgayChungTu.Text);
            objTT.HinhThucThanhToan = Conversions.ToString(this.CboHinhThuc.SelectedValue);
            objTT.LoaiTien = Conversions.ToString(this.CboLoaiTien.SelectedValue);
            objTT.TyGia = Conversions.ToDouble(this.txtTyGia.Value);
            objTT.KhoaTaiKhoanChu = this.AdvTaiKhoan.Value;
            objTT.KhoaNganHang = this.AdvNganhang.Value;
            objTT.KhoaNhanVien = this.AdvNhanVien.Value;
            objTT.KhoaDoiTuong = this.advKhachHang.Value;
            objTT.ChungTuDinhKem = this.TxtChungTuDinhKem.Text;
            objTT.DienGiai = this.TxtDienGiai.Text;
            objTT.SoTienNT = Conversions.ToDouble(this.TxtSoTienThanhToanNT.Value);
            objTT.SoTien = Conversions.ToDouble(this.TxtSoTienThanhToan.Value);
            objTT.SoTienPhanBoNT = objTT.SoTienNT - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTT.SoTienPhanBo = objTT.SoTien - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTien.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTT.KhoaDonVi = modGeneral.H_CLIENT;
            objTT.Send = 0;
            if (objTT.KhoaNhanVienTao.Trim() == "")
            {
                objTT.KhoaNhanVienTao = modGeneral.H_USERID;
            }
            if (objTT.NgayTao.Trim() == "")
            {
                objTT.NgayTao = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            }
            objTT.KhoaNhanVienSua = modGeneral.H_USERID;
            objTT.NgaySua = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            objTT.SoTienKhongPhanBoNT = Conversions.ToDouble(this.TxtSoTienKPBNT.Value);
            objTT.SoTienKhongPhanBo = Conversions.ToDouble(this.TxtSoTienKPB.Value);
            objTT.KhoaTaiKhoanDoi = this.AdvTKCo.Value;
            objTT.LoaiChungTu = "RE";
            return objTT.Save();
            objTT = null;
            return flag;
        }

        private void VSlist_AfterEdit(object sender, RowColEventArgs e)
        {
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            switch (e.Col)
            {
                case 1:
                    if (Conversion.Val(RuntimeHelpers.GetObjectValue(vSlist[e.Row, 1])) != 0.0)
                    {
                        vSlist[e.Row, 15] = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[e.Row, 13]), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[e.Row, 14]), 0, modGeneral.TypeOfValue.Nothing));
                    }
                    else
                    {
                        vSlist[e.Row, 15] = 0;
                    }
                    this.TxtSoTienThanhToan.Value = LVYModule.SumColGrid(this.VSlist, 15);
                    this.TxtSoTienThanhToanNT.Value = Microsoft.VisualBasic.CompilerServices.Operators.DivideObject(this.TxtSoTienThanhToan.Value, this.txtTyGia.Value);
                    this.TotalOfVoucher();
                    break;

                case 15:
                    if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[e.Row, 15]), 0, modGeneral.TypeOfValue.Nothing)) > (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[e.Row, 13]), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[e.Row, 14]), 0, modGeneral.TypeOfValue.Nothing))))
                    {
                        LVYModule.ShowWarning(modGeneral.Tranlated("Số tiền thanh to\x00e1n kh\x00f4ng thể lớn hơn số tiền ph\x00e1t sinh!", ""));
                    }
                    this.TotalOfVoucher();
                    break;
            }
            vSlist = null;
        }

        private void VSlist_BeforeEdit(object sender, RowColEventArgs e)
        {
            if (!this.mEnabledControl)
            {
                e.Cancel = true;
            }
            else if (e.Col != 1)
            {
                if (e.Col != 15)
                {
                    e.Cancel = true;
                }
                else if ((e.Col == 15) && (Conversion.Val(RuntimeHelpers.GetObjectValue(this.VSlist[e.Row, 1])) == 0.0))
                {
                    e.Cancel = true;
                }
            }
        }

        internal virtual ADVObjects advKhachHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._advKhachHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                ADVObjects.ValueChangedEventHandler handler = new ADVObjects.ValueChangedEventHandler(this.advKhachHang_ValueChanged);
                if (this._advKhachHang != null)
                {
                    this._advKhachHang.ValueChanged -= handler;
                }
                this._advKhachHang = value;
                if (this._advKhachHang != null)
                {
                    this._advKhachHang.ValueChanged += handler;
                }
            }
        }

        internal virtual ADVObjects AdvNganhang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvNganhang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvNganhang = value;
            }
        }

        internal virtual ADVObjects AdvNhanVien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvNhanVien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                ADVObjects.ValueChangedEventHandler handler = new ADVObjects.ValueChangedEventHandler(this.AdvNhanVien_ValueChanged);
                if (this._AdvNhanVien != null)
                {
                    this._AdvNhanVien.ValueChanged -= handler;
                }
                this._AdvNhanVien = value;
                if (this._AdvNhanVien != null)
                {
                    this._AdvNhanVien.ValueChanged += handler;
                }
            }
        }

        internal virtual ADVAccount AdvTaiKhoan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTaiKhoan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                ADVAccount.ValueChangedEventHandler handler = new ADVAccount.ValueChangedEventHandler(this.AdvTaiKhoan_ValueChanged);
                if (this._AdvTaiKhoan != null)
                {
                    this._AdvTaiKhoan.ValueChanged -= handler;
                }
                this._AdvTaiKhoan = value;
                if (this._AdvTaiKhoan != null)
                {
                    this._AdvTaiKhoan.ValueChanged += handler;
                }
            }
        }

        internal virtual ADVAccount AdvTKCo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTKCo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTKCo = value;
            }
        }

        internal virtual ComboBox CboHinhThuc
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboHinhThuc;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboHinhThuc_SelectedIndexChanged);
                if (this._CboHinhThuc != null)
                {
                    this._CboHinhThuc.SelectedIndexChanged -= handler;
                }
                this._CboHinhThuc = value;
                if (this._CboHinhThuc != null)
                {
                    this._CboHinhThuc.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual ComboBox CboLoaiTien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiTien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboLoaiTien_SelectedIndexChanged);
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged -= handler;
                }
                this._CboLoaiTien = value;
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual CheckBox CKCheckAll
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKCheckAll;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CKCheckAll = value;
            }
        }

        internal virtual ToolStripButton CmdAdd
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAdd;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAdd_Click);
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click -= handler;
                }
                this._CmdAdd = value;
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdDel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDel_Click);
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click -= handler;
                }
                this._CmdDel = value;
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdEdit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdEdit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdEdit_Click);
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click -= handler;
                }
                this._CmdEdit = value;
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdExit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExit_Click);
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click -= handler;
                }
                this._CmdExit = value;
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdFind
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdFind;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdFind_Click);
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click -= handler;
                }
                this._CmdFind = value;
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdHelp
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdHelp;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdHelp = value;
            }
        }

        internal virtual ToolStripButton CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdPrint_Click);
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click -= handler;
                }
                this._CmdPrint = value;
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdSave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdSave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdSave_Click);
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click -= handler;
                }
                this._CmdSave = value;
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdUnsave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdUnsave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdUnsave_Click);
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click -= handler;
                }
                this._CmdUnsave = value;
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click += handler;
                }
            }
        }

        internal virtual Button CmdViewCongNo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdViewCongNo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdViewCongNo_Click);
                if (this._CmdViewCongNo != null)
                {
                    this._CmdViewCongNo.Click -= handler;
                }
                this._CmdViewCongNo = value;
                if (this._CmdViewCongNo != null)
                {
                    this._CmdViewCongNo.Click += handler;
                }
            }
        }

        public bool EnabledControl
        {
            get
            {
                return this.mEnabledControl;
            }
            set
            {
                this.mEnabledControl = value;
                this.CmdAdd.Enabled = !value & this.mAllowAdd;
                this.CmdEdit.Enabled = !value & this.mAllowEdit;
                this.CmdSave.Enabled = value;
                this.CmdUnsave.Enabled = value;
                this.CmdDel.Enabled = !value & this.mAllowDel;
                this.CmdFind.Enabled = !value;
                this.CmdExit.Enabled = !value;
                this.CmdPrint.Enabled = !value;
                this.TxtSoChungTu.ReadOnly = !value;
                this.TxtNgayChungTu.Enabled = value;
                this.CboLoaiTien.Enabled = value;
                this.txtTyGia.ReadOnly = !value;
                this.TxtDienGiai.ReadOnly = !value;
                this.TxtChungTuDinhKem.ReadOnly = !value;
                this.AdvTaiKhoan.ReadOnly = !value;
                this.CboHinhThuc.Enabled = value;
                this.advKhachHang.ReadOnly = !value;
                this.AdvTKCo.ReadOnly = !value;
                this.TxtSoTienThanhToanNT.ReadOnly = !value;
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
                {
                    this.TxtSoTienThanhToanNT.ReadOnly = true;
                }
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label10
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label10;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label10 = value;
            }
        }

        internal virtual Label Label11
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label11;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label11 = value;
            }
        }

        internal virtual Label Label12
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label12;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label12 = value;
            }
        }

        internal virtual Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual Label Label14
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label14;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label14 = value;
            }
        }

        internal virtual Label Label15
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label15;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label15 = value;
            }
        }

        internal virtual Label Label16
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label16;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label16 = value;
            }
        }

        internal virtual Label Label17
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label17;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label17 = value;
            }
        }

        internal virtual Label Label18
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label18;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label18 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual Label Label5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label5 = value;
            }
        }

        internal virtual Label Label6
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label6;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label6 = value;
            }
        }

        internal virtual Label Label7
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label7;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label7 = value;
            }
        }

        internal virtual Label Label8
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label8;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label8 = value;
            }
        }

        internal virtual Label Label9
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label9;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label9 = value;
            }
        }

        internal virtual Panel Panel4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel4 = value;
            }
        }

        internal virtual Panel Panel5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel5 = value;
            }
        }

        internal virtual TabControl TabControl1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabControl1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabControl1 = value;
            }
        }

        internal virtual TabControl TabDetails
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabDetails;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabDetails = value;
            }
        }

        internal virtual TabPage TabPage1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage1 = value;
            }
        }

        internal virtual TabPage TabPage2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage2 = value;
            }
        }

        internal virtual ToolStrip ToolStrip1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStrip1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStrip1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripButton1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator3 = value;
            }
        }

        internal virtual TextBox TxtChungTuDinhKem
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtChungTuDinhKem;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtChungTuDinhKem = value;
            }
        }

        internal virtual TextBox TxtDienGiai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDienGiai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDienGiai = value;
            }
        }

        internal virtual DateTimePicker TxtNgayChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayChungTu = value;
            }
        }

        internal virtual TextBox TxtSoChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoChungTu = value;
            }
        }

        internal virtual C1NumericEdit TxtSoTien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoTien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoTien = value;
            }
        }

        internal virtual C1NumericEdit TxtSoTienKPB
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoTienKPB;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoTienKPB = value;
            }
        }

        internal virtual C1NumericEdit TxtSoTienKPBNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoTienKPBNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoTienKPBNT = value;
            }
        }

        internal virtual C1NumericEdit TxtSoTienNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoTienNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoTienNT = value;
            }
        }

        internal virtual C1NumericEdit TxtSoTienThanhToan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoTienThanhToan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoTienThanhToan = value;
            }
        }

        internal virtual C1NumericEdit TxtSoTienThanhToanNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoTienThanhToanNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtSoTienThanhToanNT_LostFocus);
                if (this._TxtSoTienThanhToanNT != null)
                {
                    this._TxtSoTienThanhToanNT.LostFocus -= handler;
                }
                this._TxtSoTienThanhToanNT = value;
                if (this._TxtSoTienThanhToanNT != null)
                {
                    this._TxtSoTienThanhToanNT.LostFocus += handler;
                }
            }
        }

        internal virtual C1NumericEdit TxtTongSoDuNo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongSoDuNo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongSoDuNo = value;
            }
        }

        internal virtual C1NumericEdit txtTyGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._txtTyGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._txtTyGia = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSlist
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSlist;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                RowColEventHandler handler = new RowColEventHandler(this.VSlist_AfterEdit);
                RowColEventHandler handler2 = new RowColEventHandler(this.VSlist_BeforeEdit);
                if (this._VSlist != null)
                {
                    this._VSlist.AfterEdit -= handler;
                    this._VSlist.BeforeEdit -= handler2;
                }
                this._VSlist = value;
                if (this._VSlist != null)
                {
                    this._VSlist.AfterEdit += handler;
                    this._VSlist.BeforeEdit += handler2;
                }
            }
        }
    }
}

